package com.zlk.algorithm.dataStructure.tree.serialize;

import java.util.List;

/**
 * @program: algorithm
 * @ClassName EncodeNaryTreeToBinaryTree
 * @description:N叉树如何通过二叉树来序列化、并完成反序列化
 *   n叉树如何转换成二叉树
 *   思路，每一个子节点放到父节点的左树右节点上
 * @author: slfang
 * @create: 2024-02-26 16:14
 * @Version 1.0
 **/
public class EncodeNaryTreeToBinaryTree {

    public  class Node {
        public int val;
        public List<Node> children;

        public Node() {
        }

        public Node(int _val) {
            val = _val;
        }

        public Node(int _val, List<Node> _children) {
            val = _val;
            children = _children;
        }
    };

    // 提交时不要提交这个类
    public  class TreeNode {
        int val;
        TreeNode left;
        TreeNode right;

        TreeNode(int x) {
            val = x;
        }
    }








}
